from Map.edge import edge
import copy
import time

def test_deepcopy():
    a = [0, 1, 2, 3, ['a', 'b', 'c']]

    st = time.time()
    print(st)
    b = a
    c = copy.copy(a)
    d = copy.deepcopy(a)

    a.append('4')
    a[4].append('d')
    print('a=:', a)
    print('b=:', b)
    print('c=:', c)
    print('d=:', d)

    d.append('5')
    a = copy.deepcopy(d)
    print('a=:', a)
    print('d=:', d)
    print(time.time() - st)


def test_edge_timeWindow():
    a = 2.6
    b = round(a)
    c = int(a)
    if (a - c == 0):
        b = a - c
    print(a, b, c, a - c)
    e = edge(1, 2, 10)
    e.add_timewind(0, 5)
    for i in range(0, 15):
        print(e.time_windows[i], end=" ")
    print(" ")
    e.add_timewind(1, 6)
    for i in range(0, 15):
        print(e.time_windows[i], end=" ")
    print(" ")
    e.add_timewind(2, 7)
    for i in range(0, 15):
        print(e.time_windows[i], end=" ")
    print(" ")
    e.add_timewind(3, 8)
    for i in range(0, 15):
        print(e.time_windows[i], end=" ")
    print(" ")
    e.add_timewind(3, 10)
    for i in range(0, 15):
        print(e.time_windows[i], end=" ")
    print(" ")
    print(e.find_timewind(3, 9))
    print(e.find_timewind(8, 10))

test_edge_timeWindow()